package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.NotebookMapper;
import com.ruoyi.ora.domain.Notebook;
import com.ruoyi.ora.service.INotebookService;

/**
 * 记事Service业务层处理
 * 
 * @author liuwp
 * @date 2025-04-10
 */
@Service
public class NotebookServiceImpl implements INotebookService 
{
    @Autowired
    private NotebookMapper notebookMapper;

    /**
     * 查询记事
     * 
     * @param id 记事主键
     * @return 记事
     */
    @Override
    public Notebook selectNotebookById(Long id)
    {
        return notebookMapper.selectNotebookById(id);
    }

    /**
     * 查询记事列表
     * 
     * @param notebook 记事
     * @return 记事
     */
    @Override
    public List<Notebook> selectNotebookList(Notebook notebook)
    {
        return notebookMapper.selectNotebookList(notebook);
    }

    /**
     * 根据业务主键查询一条记录：记事
     *
     * @param notebook 记事
     * @return 记事
     */
    @Override
    public Notebook selectOneNotebook(Notebook notebook)
    {
        return notebookMapper.selectOneNotebook(notebook);
    }

    /**
     * 新增记事
     * 
     * @param notebook 记事
     * @return 结果
     */
    @Override
    public int insertNotebook(Notebook notebook)
    {
        notebook.setCreateTime(DateUtils.getNowDate());
        return notebookMapper.insertNotebook(notebook);
    }

    /**
     * 修改记事
     * 
     * @param notebook 记事
     * @return 结果
     */
    @Override
    public int updateNotebook(Notebook notebook)
    {
        return notebookMapper.updateNotebook(notebook);
    }

    @Override
    public int updateNotebookCondition(Notebook notebook, Notebook notebookCondition)
    {
        return notebookMapper.updateNotebookCondition(notebook, notebookCondition);
    }

    /**
     * 批量删除记事
     * 
     * @param ids 需要删除的记事主键
     * @return 结果
     */
    @Override
    public int deleteNotebookByIds(Long[] ids)
    {
        return notebookMapper.deleteNotebookByIds(ids);
    }

    /**
     * 删除记事信息
     * 
     * @param id 记事主键
     * @return 结果
     */
    @Override
    public int deleteNotebookById(Long id)
    {
        return notebookMapper.deleteNotebookById(id);
    }

    /**
     * 条件删除记事
     *
     * @param notebook 记事
     * @return 结果
     */
    @Override
    public int deleteNotebookByCondition(Notebook notebook)
    {
        return notebookMapper.deleteNotebookByCondition(notebook);
    }

}
